/*
 * @Date: 2022-06-29 09:25:09
 * @LastEditTime: 2022-07-14 06:05:08
 */
import Vue from 'vue'
import Router from 'vue-router'
const Home = () => import('@/views/common/Home')
const Login = () => import('@/views/common/Login')
const LoginPanel = () => import('@/components/login/LoginPanel')
const RegisterPanel = () => import('@/components/login/RegisterPanel')
const UserMain = () => import('@/components/user/UserMain')
const UserPanel = () => import('@/components/user/UserPanel')
const Homeview = () => import('@/components/home/Homeview')
const HomePanel = () => import('@/components/home/HomePanel')
const RankDisplay = () => import('@/components/display/rank/RankDisplay')
const UserInfoChange = () => import('@/components/user/UserInfoChange')
const ChatMain = () => import('@/components/chat/ChatMain')
const MovieDetail = () => import('@/components/display/MovieDetail')

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HomeRoot',
      component: Home,
      children: [
        {
          path: '',
          name: 'Home',
          components: {
            main: Homeview,
            aside: HomePanel
          }
        },
        {
          path: '/user/:id(\\d+)',
          name: 'user',
          components: {
            main: UserMain,
            aside: UserPanel
          }
        },
        {
          path: '/rank',
          name: 'rank',
          components: {
            main: RankDisplay,
            aside: HomePanel
          }
        },
        {
          path: '/user/change',
          name: 'UserInfoChange',
          components: {
            main: UserInfoChange,
            aside: UserPanel
          }
        },
        {
          path: '/chat/:id(\\d+)',
          name: 'Chat',
          components: {
            main: ChatMain
            // aside: UserPanel
          }
        },
        {
          path: '/movie/:id(\\d+)',
          name: 'MovieDetail',
          components: {
            main: MovieDetail,
            aside: HomePanel
          }
        }
      ]
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
      children: [
        {
          path: '/login',
          name: 'LoginPanel',
          component: LoginPanel
        },
        {
          path: '/register',
          name: 'RegisterPanel',
          component: RegisterPanel
        }
      ]
    }
  ]
})
